package com.zzw.tddl;

import java.text.MessageFormat;

/**
 * 描述
 *
 * @author zhulixin
 */
public class AucsRuleSingleMain {

    public static void main(String[] args) throws Exception {
        System.setProperty("nacos.endpoint", "midenv.to5.mychebao.com");
        //ConfigService configService = NacosFactory.createConfigService();
        String app = "lms";
        //String tableCount = "4";
        //String tableSingleDb = "2";

        // 插入版本号
        String dataId = new MessageFormat("com.taobao.tddl.rule.le.{0}.versions").format(new Object[]{app});
        String version = "V1";

        // 插入规则
        dataId = new MessageFormat("com.taobao.tddl.rule.le.{0}.{1}").format(new Object[]{app, version});
        String content = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                "<!DOCTYPE beans PUBLIC \"-//SPRING//DTD BEAN//EN\" \"http://www.springframework.org/dtd/spring-beans.dtd\">\n" +
                "<beans>\n" +
                "    <bean id=\"vtabroot\" class=\"com.taobao.tddl.rule.VirtualTableRoot\" init-method=\"init\">\n" +
                "        <property name=\"dbType\" value=\"MYSQL\" />\n" +
                "        <property name=\"lazyInit\" value=\"true\" />\n" +
                "        <property name=\"defaultDbIndex\" value=\"" + app + "_main\"/>\n" +
                "    </bean>\n" +
                "\n" +
                "</beans>";
    }
}
